});
}
- async updateSearch(providerResults, terms, callback) {
+ async updateSearch(providerResults, terms) {
this._terms = terms;
if (providerResults.length === 0) {
this._clearResultDisplay();
this.hide();
- callback();
} else {
const maxResults = this._getMaxDisplayedResults();
const results = maxResults > -1
resultId => this._addItem(this._resultDisplays[resultId]));
this._setMoreCount(this.provider.canLaunchSearch ? moreCount : 0);
this.show();
- callback();
} catch {
this._clearResultDisplay();
- callback();
}
}
}
}
this._results[provider.id] = results;
- this._updateResults(provider, results);
+ await this._updateResults(provider, results);
}
_doSearch() {
}
}
- _updateResults(provider, results) {
+ async _updateResults(provider, results) {
const terms = this._terms;
const display = provider.display;
- display.updateSearch(results, terms, () => {
+ try {
+ await display.updateSearch(results, terms);
+ } finally {
provider.searchInProgress = false;
this._maybeSetInitialSelection();
this._updateSearchProgress();
- });
+ }
}
activateDefault() {